package com.zking.web.ly;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.zking.dao.domain.MyResume;
import com.zking.dao.domain.Resume;
import com.zking.service.ly.ResumeService;

@Controller
public class ResumeController {
	@Autowired
	private ResumeService rs;
	
	@RequestMapping(value = "/intoly")
	public ModelAndView into(Integer user_id,Resume resume, HttpServletRequest request,Integer information_id) {
		ModelAndView modelAndView = new ModelAndView();
		MyResume mrs = rs.inquire(user_id);
		System.out.println("========"+mrs.getCity());
		if ("null".equals(mrs.getCity())) {
			modelAndView.setViewName("jianli");
		} else {
			resume.setName(mrs.getName());
			resume.setSex(mrs.getSex());
			resume.setPicture(mrs.getPicture());
			resume.setDiploma(mrs.getDiploma());
			resume.setEducation_time(mrs.getEducation_time());
			resume.setPhone(mrs.getPhone());
			resume.setEmail(mrs.getEmail());
			resume.setStatus(mrs.getStatus());
			resume.setCity(mrs.getCity());
			resume.setWork_type(mrs.getWork_type());
			resume.setPosition(mrs.getPosition());
			resume.setSalary(mrs.getSalary());
			resume.setCompany_name(mrs.getCompany_name());
			resume.setCompany_position(mrs.getCompany_position());
			resume.setCompany_time(mrs.getCompany_time());
			resume.setCom_month(mrs.getCom_month());
			resume.setCom_endyear(mrs.getCom_endyear());
			resume.setCom_endmonth(mrs.getCom_endmonth());
			resume.setPj_name(mrs.getPj_name());
			resume.setPj_position(mrs.getPj_position());
			resume.setPj_time_year(mrs.getPj_time_year());
			resume.setPj_time_month(mrs.getPj_time_month());
			resume.setPj_end_year(mrs.getPj_end_year());
			resume.setPj_end_month(mrs.getPj_end_month());
			resume.setPj_description(mrs.getPj_description());
			resume.setSchool_name(mrs.getSchool_name());
			resume.setEducation_type(mrs.getEducation_type());
			resume.setProfessional(mrs.getProfessional());
			resume.setSchool_time_start(mrs.getSchool_time_start());
			resume.setSchool_time_end(mrs.getSchool_time_end());
			resume.setIntroduction(mrs.getIntroduction());
			resume.setUser_id(mrs.getUser_id());
			resume.setState("未审核");
			resume.setInformation_id(information_id);
			int i = rs.into(resume);
			modelAndView.addObject("mrs", i);
			modelAndView.setViewName("jobdetail1");
		}
		return modelAndView;
	}
}